import React from 'react';
import Image from 'components/Image'
import {Row, Col} from 'antd';

export const columns = [
    {
        title: "商品清单",
        dataIndex: "goodImg",
        width: 280,
        className: "bdr0",
        render: (v, record, index) => {
            return {
                children: (
                    <div className="order-goods-item">
                        <Row>
                            <Col span={18}>
                                <div className="order-goods-info">
                                    <Image src={record.picUrl} alt={record.itemName}/>
                                    <p className="good-name">{record.itemName}</p>
                                    <p className="t-grayer">
                                        {
                                            !!record.productSpecification
                                                ?
                                                ['规格', record.productSpecification].join(':')
                                                :
                                                null
                                        }
                                    </p>
                                </div>
                            </Col>
                            <Col span={6}>
                                <div className="pull-right">
                                    <div className="table-cell">
                                        <div className="goods-price t-right">
                                            <p className="real-price"><span>&yen;{(record.pervalue || 0).toFixed(2)}</span></p>
                                            {
                                                record.salePrice != record.pervalue
                                                    ?
                                                    <p><del className="price-pre t-grayer"><span>&yen;{(record.salePrice || 0).toFixed(2)}</span></del></p>
                                                    :
                                                    null
                                            }
                                            <p className="t-grayer">&times;{record.itemNumber}</p>
                                        </div>
                                    </div>
                                </div>
                            </Col>
                        </Row>
                    </div>
                ),
                props: {
                    colSpan: 2,
                },
            }
        }
    },
    {
        title: "单价／数量",
        width: 100,
        className: "ant-table-th-right",
        dataIndex: "realPrice",
        render: () => {
            return {
                children: {},
                props: {
                    colSpan: 0,
                },
            }
        }
    },
    {
        title: "小计",
        width: 150,
        className: "ant-table-th-center",
        dataIndex: "realPay",
        render: (v, record, index) => <span className="font-14 t-price">&yen;{(record.totalCash || 0).toFixed(2)}</span>
    }
]